package com.study;

import java.time.LocalDate;

public class Dvd {
    private String title;  // 标题
    private String genre;  // 类型
    private boolean available;  // 是否可借
    private boolean rented;  // 是否已借出
    private int rentalFee;  // 租金
    private int lateFee;  // 滞纳金
    private int deposit;  // 押金
    private int days;  // 租借天数
    private LocalDate rentedDate;  // 租借日期

    public Dvd(String title, String genre, boolean available, boolean rented, int rentalFee, int lateFee, int deposit) {
        this.title = title;
        this.genre = genre;
        this.available = available;
        this.rented = rented;
        this.rentalFee = rentalFee;
        this.lateFee = lateFee;
        this.deposit = deposit;
        this.days = 0;
        this.rentedDate = null;
    }

    public String getTitle() {
        return title;
    }

    public String getGenre() {
        return genre;
    }

    public boolean isAvailable() {
        return available;
    }

    public void setAvailable(boolean available) {
        this.available = available;
    }

    public boolean isRented() {
        return rented;
    }

    public void setRented(boolean rented) {
        this.rented = rented;
    }

    public int getRentalFee() {
        return rentalFee;
    }

    public int getLateFee() {
        return lateFee;
    }

    public int getDeposit() {
        return deposit;
    }

    public int getDays() {
        return days;
    }

    public void setDays(int days) {
        this.days = days;
    }

    public LocalDate getRentedDate() {
        return rentedDate;
    }

    public void setRentedDate(LocalDate rentedDate) {
        this.rentedDate = rentedDate;
    }

    @Override
    public String toString() {
        return "DVD信息：\n" +
                "标题：" + title + "\n" +
                "类型：" + genre + "\n" +
                "是否可借：" + available + "\n" +
                "是否已借出：" + rented + "\n" +
                "租金：" + rentalFee + "元/天\n" +
                "滞纳金：" + lateFee + "元/天\n" +
                "押金：" + deposit + "元\n";
    }
}